<!doctype html>
<html lang="en">
  <head>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, minimum-scale=1, initial-scale=1, user-scalable=yes">

    <title>app-main test</title>

    <script src="../../../webcomponentsjs/webcomponents-lite.js"></script>
    <script src="../../../web-component-tester/browser.js"></script>

    <link rel="import" href="../../src/app-main/app-main.html">
  </head>
  <body>

    <test-fixture id="BasicTestFixture">
      <template>
        <app-main></app-main>
      </template>
    </test-fixture>

    <test-fixture id="ChangedPropertyTestFixture">
      <template>
        <app-main prop1="new-prop1"></app-main>
      </template>
    </test-fixture>

    <script>
      suite('app-main', function() {

        test('instantiating the element with default properties works', function() {
          var element = fixture('BasicTestFixture');
          assert.equal(element.prop1, 'app-main');
          var elementShadowRoot = element.shadowRoot;
          var elementHeader = elementShadowRoot.querySelector('h2');
          assert.equal(elementHeader.innerHTML, 'Hello app-main!');
        });

        test('setting a property on the element works', function() {
          // Create a test fixture
          var element = fixture('ChangedPropertyTestFixture');
          assert.equal(element.prop1, 'new-prop1');
          var elementShadowRoot = element.shadowRoot;
          var elementHeader = elementShadowRoot.querySelector('h2');
          assert.equal(elementHeader.innerHTML, 'Hello new-prop1!');
        });

      });
    </script>


  </body>
</html>
